package speedball;

import javafx.scene.effect.BlendMode;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Shape;

public class ShapeManage {

	/**
	 * 创建圆
	 * 
	 * @param circleSize
	 * @return
	 */
	public static Circle createCircle(double circleSize) {
		Circle circle = new Circle();
		circle.setCenterX(circleSize);
		circle.setCenterY(circleSize);
		circle.setRadius(circleSize);
		circle.setStroke(Color.rgb(245, 245, 245));
		circle.setFill(Color.rgb(245, 245, 245));
//		circle.union(circle, path);
		circle.setBlendMode(BlendMode.SRC_OVER);
		return circle;
	}
	
	
	
	
	/**
	 * 创建圆
	 * 
	 * @param circleSize
	 * @return
	 */
	public static Ellipse createEllipse(double circleSize,double radiusX,double radiusY) {
		Ellipse ellipse = new Ellipse();
	    ellipse.setCenterX(circleSize);
	    ellipse.setCenterY(circleSize);
	    ellipse.setRadiusX(radiusX);
	    ellipse.setRadiusY(radiusY);
//	    ellipse.setEffect(ds);
		return ellipse;
	}
	

	/**
	 * 创建圆角长方形
	 * 
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 * @param arcWidth
	 * @param arcHeight
	 * @return
	 */
	public static Rectangle createRectangle(double x, double y, double width, double height, double arcWidth,
			double arcHeight) {
		Rectangle rect = createRectangle(x, y, width, height);
		rect.setArcWidth(arcWidth);
		rect.setArcHeight(arcHeight);
		return rect;

	}

	/**
	 * 创建长方形
	 * 
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 * @return
	 */
	public static Rectangle createRectangle(double x, double y, double width, double height) {
		Rectangle rect = new Rectangle(x, y, width, height);
		return rect;

	}

	/**
	 * 创建长方形
	 * 
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 * @return
	 */
	public static Shape createRing(double x, double y, double innerRadius, double ringWidth) {

		Circle outsideCircle = new Circle(innerRadius + ringWidth);
		Circle innerCircle = new Circle(innerRadius);

		Shape ring = outsideCircle.subtract(outsideCircle, innerCircle);
		ring.setLayoutX(x);
		ring.setLayoutY(y);
		return ring;

	}

	/**
	 * 克隆
	 * 
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 * @return
	 */
	public static Shape cloneShape(Shape shape, double rotate) {

//		shape.clone();

		return null;

	}

}
